package leetcode

 type ListNode struct {
     Val int
     Next *ListNode
 }

 func getIntersectionNode(headA, headB *ListNode) *ListNode {
    nodeIn_headA := map[*ListNode]bool{}
	for node := headA; node != nil; node = node.Next {
		nodeIn_headA[node] = true
	}

	for node := headB; node != nil; node = node.Next {
		if nodeIn_headA[node] {
			return node
		}
	}

	return nil

}